﻿using Autodesk.AutoCAD.DatabaseServices;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using System.Xml.Serialization;

namespace AutoCadConvert
{
    [Serializable]
    public class BspObject
    {
        public virtual IEnumerable<XElement> ToXml() { return new XElement[] { }; }
        public virtual IEnumerable<BspObject> FromXml(XElement node) { return new BspObject[] { }; }
        public virtual void AddData(Entity value) { }
        public virtual void AjustLineAndPoint() { }

        public static double dWallHeight = 2800;
        //autocad数据保留小数点几位
        protected int iPresicion = 2;
        //图纸单位
        public static UnitsValue s_unitValue;
        protected static double Unit
        {
            get
            {//统一厘米单位
                switch (s_unitValue)
                {
                    case UnitsValue.Undefined: return 0.1;
                    case UnitsValue.Meters: return 100;
                    case UnitsValue.Centimeters: return 1;
                    case UnitsValue.Millimeters: return 0.1;
                    case UnitsValue.Inches: return 2.54;
                    case UnitsValue.Feet: return 30.48;
                    case UnitsValue.Miles: return 160934.4;
                    default: return 1;
                }
            }
        }
    }
}
